<?php

include_once $_SERVER['DOCUMENT_ROOT'].'HelmesWorkTest/frontend/controller/commands/Command.php';
include_once $_SERVER['DOCUMENT_ROOT'].'HelmesWorkTest/frontend/controller/commands/FillInsertPersonSectorInvolvementWithSessionDataCommand.php';
include_once $_SERVER['DOCUMENT_ROOT'].'HelmesWorkTest/frontend/controller/commands/InsertPersonSectorInvolvementCommand.php';

/**
 * Description of PersonSectorInvolvementCommandFactory
 *
 * @author Reinowin7
 */
class PersonSectorInvolvementCommandFactory
{
    public function getCommand($triggeringEvent)
    {
        $command = null;

        try 
        {
            if ($triggeringEvent == "insertPersonSectorInvolvementPage")
            {
                $command = new FillInsertPersonSectorInvolvementWithSessionDataCommand();
            }

            if ($triggeringEvent == "insertPersonSectorInvolvementFormPostEvent")
            {
                $command = new InsertPersonSectorInvolvementCommand();
            }
        }
        catch (Exception $e)
        {
            $e->printStackTrace();
        }

        return $command;
    }
}

?>
